#
#
# make MACRO="value" [MACRO="value" ...] TARGET [TARGET ...]
#
#

PACKAGE = obs
VERSION = ` date +"%Y%m%d" `
RELEASE_DIR = ../dist
ARCHIVE = $(PACKAGE)-$(VERSION)

CFLAGS += -Wall -c -g -I../src -I../include
LDFLAG += -lc

depend:
	@echo "Generating dependencies..."
	@mkdep $(CFLAGS) $(SRCS)
	@rm -f depend

dist:
	@# Notice that only now macros are expanded for shell to interpert:
	@# 		tar -cf package-`data + "%Y%m%d"`.tar
	@#
	@echo [TAR] $(ARCHIVE).tar.gz $(CURR_DIR)
	@cd $(RELEASE_DIR); \
		tar -czf $(ARCHIVE).tar.gz $(DIST)

help:
	@#egrep "^# target:" BSDmakefile [Mm]akefile
	@echo SRCS: $(SRCS)
	@echo OBJS: $(OBJS)

list:
	@cd src; \
		ls

.SUFFIX: .c .o

.c.o:
	@echo [CC 0] $<
	@$(CC) -o $@ $(CFLAGS) $<

.PHONY: clean

clean: $(OBJS)
	@echo [RM] $(OBJS)
	-@rm  -f $(OBJS)

# This pseudo target causes all targets that depend on FRC to be remade even 
# in case a file with the name of the target exists.
# This works with any make implementation under the assumptioin that there is
# no file FRC in the current directory.
FRC:

